/* $RCSFile: ViewItemPage.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.Core/UI/ViewItemPage.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:29  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.IO;
using System.Configuration;
using System.Collections;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using AddonNice.UI;
using AddonNice.UI.WebControls;
using AddonNice.Security;
using AddonNice.Configuration;

namespace AddonNice.UI
{
	public class ViewItemPage : StdAuxPage
    {

        public ViewItemPage()
            : base(false, false, false,false)
        { }

		/// <summary>
		/// Handles OnUpdate event
		/// </summary>
		protected override void OnUpdate(ADNPageEventArgs e) 
		{
			// Verify that the current user has access to add in this entity
            if (!string.IsNullOrEmpty(EntityName) && !PortalSecurity.HasAddPermissions(EntityName) && !PortalSecurity.HasUpdatePermissions(EntityName))
                PortalSecurity.AccessDeniedEdit();
			base.OnUpdate(e);
		}


        /// <summary>
        /// Load settings
        /// </summary>
        protected override void LoadSettings()
        {
            // Verify that the current user has access to view this module
            if (!string.IsNullOrEmpty(EntityName) && !PortalSecurity.HasViewPermissions(EntityName)) 
                PortalSecurity.AccessDenied();
            base.LoadSettings();
        }
    }
}